﻿@model IEnumerable<GSLMS.Entity.TB_SYS_USERPRIV>
@{
    Layout = null;
    var Roles = ViewData["Roles"] as List<GSLMS.Entity.Role> ?? new List<GSLMS.Entity.Role>();
    int i = 0;
}
<div class="pageContent">
    <form method="post" action="System/Employee/EditRoels?OpID=@ViewData["OperateID"]" class="pageForm required-validate"
    onsubmit="return validateCallback(this, dialogAjaxDone)">
    @Html.ValidationSummary(true)
    <div class="title">
        <h4>@Request["UserName"]</h4>
    </div>
    <table class="list nowrap" width="90%" layouth="5">
        <thead>
            <tr>
                <th>
                    选择
                </th>
                <th>
                    角色
                </th>
            </tr>
        </thead>
        <tbody>
            @foreach (var item in Roles)
            { 
                <tr>
                    <td>
                        @Html.Hidden("EMPID[" + i + "]", ViewData["EMPID"])
                        @Html.Hidden("UserName[" + i + "]", Request["UserName"])
                        @Html.CheckBox("RoleID[" + i + "]", Model.SingleOrDefault(c => c.ROLEID == item.ID) != null)
                    </td>
                    <td>
                        @item.Name
                    </td>
                </tr>
                i += 1;
            }
        </tbody>
    </table>
    @Html.Partial("FormButtonBar")
    </form>
</div>
